from django.db import models

# Create your models here.

# 用户表
class User(models.Model):
    name = models.CharField(max_length=200)
    password = models.CharField(max_length=200)
    tel = models.CharField(max_length=11,default=None)
    vip = models.IntegerField(default=None)


    class Meta:
        db_table = 'user'

# 商品表
class Good(models.Model):
    name = models.CharField(max_length=200)
    price = models.CharField(max_length=200)
    vip_price = models.CharField(max_length=200)
    img = models.CharField(max_length=200)

    class Meta:
        db_table = 'good'
# 订单表
class Ding(models.Model):
    uid = models.ForeignKey(User,on_delete=models.CASCADE)
    gid = models.ForeignKey(Good,on_delete=models.CASCADE)
    objects = models.Manager()
    class Meta:
        db_table = 'ding'

